<template>
	<view>
		<up-navbar leftIconColor="#FFFFFF" leftIconSize="44rpx" :title="title" :autoBack="true" placeholder
			bgColor="transparent">
		</up-navbar>

		<view class="content">
			<up-parse :content="content"></up-parse>
		</view>
	</view>
</template>

<script setup>
	import openApi from "@/api/biz/open.js"
	import {
		ref
	} from "vue"
	import {
		onLoad
	} from "@dcloudio/uni-app"

	function getAgreement(id) {
		openApi.getAgreement({
			id
		}).then(res => {
			content.value = res.data.content
		})
	}

	const title = ref("")
	const content = ref("")
	onLoad((option) => {
		let id = option.type === '3' ? 2 : 1
		title.value = option.type === '3' ? '用户协议' : '隐私协议'
		getAgreement(id)
	})
</script>

<style>
	page {
		background-color: #1B1829;
	}
</style>
<style lang="scss" scoped>
	.content {
		padding: 30rpx;
		color: #fff;
	}
</style>